package com.hopu.oa.dao.daymanage;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hopu.oa.entity.daymanage.AoaScheduleList;
import com.hopu.oa.entity.management.AoaStatusList;
import com.hopu.oa.entity.management.AoaTypeList;
import com.hopu.oa.entity.user.AoaUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DayManageDao extends BaseMapper<AoaScheduleList> {
    @Select("select * from aoa_status_list where status_model = 'aoa_schedule_list'")
    List<AoaStatusList> selectStatus();

    @Select("select * from aoa_type_list where type_model = 'aoa_schedule_list'")
    List<AoaTypeList> selectType();

    @Select("select * from aoa_schedule_list where rc_id = #{rcid}")
    AoaScheduleList selectSchedule(Integer rcid);

    @Insert("insert into aoa_schedule_user (rcid,user_id) values (#{rcid},#{uid})")
    void insertASU(Integer rcid, Integer uid);

    @Delete("delete from aoa_schedule_user where rcid = #{rcid}")
    void deleteASU(Integer rcid);

    List<AoaScheduleList> selectAll(@Param("id") Integer id, @Param("str") String str, @Param("page") Integer page, @Param("size") Integer size);

    AoaUser selectName(String name);


}